package com.neuedu.thread;

/**
 * 项目：      javaadvice
 * 类名:       MyTicket
 * 创建时间：  2020/11/24  9:24
 * 描述 :
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      https://jshand.gitee.io
 */
public class MyTicket implements  Runnable {
    private boolean isStop = false;
    private boolean running = true;
    @Override
    public void run() {
       while(isStop){
            System.out.println("Ticket ...  "+System.currentTimeMillis()+"\tpre\t"+Thread.currentThread().getPriority());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            if(isStop) {
                break;
            }
        }
    }

    public boolean isStop() {
        return isStop;
    }

    public void setStop(boolean stop) {
        isStop = stop;
    }
}